<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      const info = {
        // name: "jack",
        // size: {
        //   w: 100,
        //   h: 200,
        // },
        style: {
          border: {
            width: 100,
          },
        },
      };
      console.log(info.name); //undefined
      console.log(info.size); //undefined
      console.log(info.style?.border?.width);

      if (info.size !== undefined) {
        console.log(info.size.h); //error
      }
    </script>
  </body>
</html>
